window.addEventListener("load", function () {
	// 头部移入效果
	// $("#headerNav li")
	// console.log($("#headerNav li"));
	$("#headerNav li").forEach((v) => {
		v.addEventListener("mouseover", function () {
			$("#headerNav li").forEach((each) => {
				each.className = "";
			});
			v.className = "active";
		});
	});
	//尾部,回到顶部功能
	//【回到顶部】
	$(".goTop").style.opacity = "0";
	this.addEventListener("scroll", function () {
		if ($(".goTop") < 3000) {
			$(".goTop").style.opacity = "0";
		} else {
			$(".goTop").style.opacity = "1";
		}
	});
	$(".goTop").addEventListener("click", function () {
		window.scroll({
			top: 0,
			left: 0,
			behavior: "smooth",
		});
	});
});
